/*
 * Copyright (c) 2018, ZeeSec Technologies. All rights reserved.
 * ZeeSec PROPRIETARY/CONFIDENTIAL.
 */

package springtest.httpClient;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.util.EntityUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

/**
 * @author ZhiQiang Chen
 * @date 2018-11-22 10:09:20
 */

public class TestGetHtml {
    public static void main(String[] args) throws Exception {
        HttpClient httpClient = HttpClientUtils.getHttpClient();
        HttpGet get = new HttpGet("https://192.168.1.145:32388");
        HttpResponse response = httpClient.execute(get);
        HttpEntity entity = response.getEntity();
        String result = EntityUtils.toString(entity, "UTF-8");
        System.out.print(result);
        Document doc = Jsoup.connect("https://192.168.1.145:32388").validateTLSCertificates(false).get();
        Element elementById = doc.getElementById("rsa_key");
        System.out.println(elementById.attr("value"));
    }

}
